Richard G Baldwin (512) 223-4758, NRG Room 4238, Baldwin@DickBaldwin.com, http://www.austincc.edu/baldwin

INEW 2338 Advanced Java Programming

Assignment 1 for Chapter 2

Revised 10/23/04

The files that you deliver for this assignment must include a controlling class file named Asg02_01.class plus all of the source code files that you compiled to produce your class files.

Click here for general requirements regarding all programming assignments.

Click here to download a zip file containing a sample version of this assignment.  Your application must replicate the look, feel, and behavior of this sample except that your name must be included in the output of your version of the application where indicated.

Before beginning to work on this assignment, you should study the study guide entitled Network Programming.

Write the Java application described below.

The name of the controlling class for this application must be Asg02_01.java.  This application is a simple http client program with a hard-coded target URL.

The program produces output text on the screen.  The first line of output must be your name and that must be followed by a blank line as shown in Figure 1.

Following the blank line, the output consists of the raw text contained in the file named page1.html, which is located at the following URL: http://www.austincc.edu/baldwin/page1.html.

(Note:  Your instructor may elect to store the file on a different server with a different URL.  If so, your instructor will provide the correct URL for you to use.)

Note that Figure 1 shows only the first eight lines of the raw html text contained in the file.

In other words, your program connects to the server at the specified URL, downloads the html file, and displays the html file on the screen.  Then the program terminates.

Your output should be very similar to that shown in Figure 1, keeping in mind that your output will be much longer than that shown in Figure 1.

If you need to know the details of the html text contained in the file, you can view the html source using your regular browser.

Put your name here

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I) [Netscape]">
<title>Java and JavaScript Programming, by Richard G Baldwin</title>
</head>
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000" lang="EN-US">
...
...

Figure 1

-end-

File:  Asg02_01.htm